﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CloudDcPc.Entity
{
    public class User
    {
        public User()
        {

        }
        public User(int id,string user_num,string uname,string pwd,string dep,int type)
        {
            Id = id;
            User_num = user_num;
            Uname = uname;
            Pwd = pwd;
            Dep = dep;
            Type = type;
        }

        public override string ToString()
        {
            return Uname+"("+User_num+")";
        }


        //文字版类型
        public string TextType
        {
            get { 
                if(Type==1)
                    return "点菜员";
                if (Type == 2)
                    return "收银员";
                if (Type == 3)
                    return "经理";
                if (Type == 4)
                    return "总经理";
                return "未知";
            }
            set
            {
                if (value == "点菜员")
                    Type = 1;
                if (value == "收银员")
                    Type = 2;
                if (value == "经理")
                    Type = 3;
                if (value == "总经理")
                    Type = 4;
            }
        }
        

        private int id;

        public int Id
        {
            get { return id; }
            set { id = value; }
        }
        private string user_num;

        public string User_num
        {
            get { return user_num; }
            set { user_num = value; }
        }
        private string uname;

        public string Uname
        {
            get { return uname; }
            set { uname = value; }
        }
        private string pwd;

        public string Pwd
        {
            get { return pwd; }
            set { pwd = value; }
        }
        private string dep;

        public string Dep
        {
            get { return dep; }
            set { dep = value; }
        }
        private int type;

        public int Type
        {
            get { return type; }
            set { type = value; }
        }

    }
}
